package cn.edu.scau.cmi.huangzhiyuan.composite.safe;

/**
 * 定义树枝和叶子共同部分
 */
public abstract class Component {
	// 节点类型
	private Type type;
	// 节点名字
	private String name;
	
	public Component(Type type, String name) {
		this.type = type;
		this.name = name;
	}
	
	/**
	 * 打印节点信息
	 * @return
	 */
	public String getInfo() {
		return this.type.toString() + " : " + this.name;
	}
}
